home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
intrvews
/
xhyper.lha
/
XHyper_v1.1
/
src
/
HyperView.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-01-14
|
4KB
|
127 lines
/*
* Copyright (c) 1992 U.S. Geological Survey (USGS)
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of USGS not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. USGS makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* USGS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL USGS
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
/*
* HyperViewer
*/
#ifndef HyperViewer_h
#define HyperViewer_h
#include <InterViews/window.h>
#include <InterViews/handler.h>
#include <stdio.h>
class Button;
class Item;
class Application;
class Font;
class Color;
class Hypertext_Stack;
class ItemView;
class TextItem;
class TextItem_List;
class TextView;
class TabularItem;
class TOC_List;
class PSFigItem;
class RefItem;
class PageButton;
class PagenumberItem;
class CounterItem;
class LabelItem;
class FloatItem;
//
// *** Table of Contents item
//
class TOCItem
{
public:
char* _section; // section number
char* _filename; // file containing section
char* _tag; // hypertext tag
int _offset; // character offset into document
};
//
// *** List of currently loaded TextViews
//
class TextItem
{
public:
TextView* _view; // View of MML file
};
//
// *** Stack entry of previous hypertext sources
//
class HyperSource
{
public:
int _item; // index of text item
int _page; // character offsets
};
class HyperViewer : public ApplicationWindow, public Handler {
public:
HyperViewer (const char*); // constructor
virtual boolean event (Event&); // catches mouse/keyboard events
virtual void command(const char*); // handles specific user requests
virtual void page_to(int); // changes the viewed page
virtual void updateTOC(FILE*, int);// update offet in TOC list
virtual void nextview(); // view next file in TOC
virtual void prevview(); // view prev file in TOC
virtual void pop(); // pop to hypertext source
virtual ~HyperViewer (); // destructor
virtual void hypertext(int); // hypertext to given section
int TOC(char*); // find TOC index for given tag
TOC_List* _toc; // Table of contents items
protected:
virtual void jump_to(int); // jump to hypertext offset
virtual void readTOC(FILE*); // read the Table of Contents
char* _home; // home directory of document
int _current_page; // currently viewed page
int _page_count; // total number of pages in doc
Coord _page_width; // width of page in points
Coord _page_height; // height of page in points
int _item; // current TextView
class Patch* _top; // top level patch
class Patch* _body_patch; // helpview patch
class Patch* _footer_patch; // items below viewed page
class Patch* _page_patch; // patch of text view
TextItem_List* _textlist; // text view
Hypertext_Stack* _hyperstack; // stack of hypertext sources
Button* _prev_page; // previous page button
Button* _next_page; // next page button
Button* _pop; // pop to prehypertext location
Button* _print; // print page button
Button* _quit; // exit helpview
};
#endif